﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using SD.Database.Classes;
using DBAccess;

namespace SD.Database
{
    /// <summary>
    /// Provide access to configuration data
    /// </summary>
    public class Configuration
    {
        public static int MaxNumberOfPlayers()
        {
            return DAL.GetInstance().GetInt("Select MaxNumberOfPlayers from configuration");
        }
        public static int MaxNumberOfPlanetsPerSystem()
        {
            return DAL.GetInstance().GetInt("Select MaxNumberOfPlanetsPerSystem from configuration");
        }
        public static int MinNumberOfPlanetsPerSystem()
        {
            return DAL.GetInstance().GetInt("Select MinNumberOfPlanetsPerSystem from configuration");
        }
        public static string GetConfigurationForOption(string option)
        {
            return DAL.GetInstance().GetScalar("Select " + option + " from configuration");
        }
        public static DateTime GetGameStart()
        {
            return DateTime.Parse(GetConfigurationForOption("GameStart"));
        }
    };
}